all: s3pic_cntl s3pic_prog s3pic_dump s3pic_readconfig s3pic_writeconfig

s3pic_cntl: s3pic_cntl.o icsp.o
	gcc -o s3pic_cntl s3pic_cntl.o icsp.o

s3pic_prog: s3pic_prog.o icsp.o
	gcc -o s3pic_prog s3pic_prog.o icsp.o

s3pic_dump: s3pic_dump.o icsp.o
	gcc -o s3pic_dump s3pic_dump.o icsp.o

s3pic_readconfig: s3pic_readconfig.o icsp.o
	gcc -o s3pic_readconfig s3pic_readconfig.o icsp.o

s3pic_writeconfig: s3pic_writeconfig.o icsp.o
	gcc -o s3pic_writeconfig s3pic_writeconfig.o icsp.o

icsp.o: icsp.h icsp.c
	gcc -o icsp.o -c icsp.c

s3pic_cntl.o: s3pic_cntl.c icsp.h
	gcc -o s3pic_cntl.o -c s3pic_cntl.c

s3pic_prog.o: s3pic_prog.c icsp.h
	gcc -o s3pic_prog.o -c s3pic_prog.c

s3pic_dump.o: s3pic_dump.c icsp.h
	gcc -o s3pic_dump.o -c s3pic_dump.c

s3pic_readconfig.o: s3pic_readconfig.c icsp.h
	gcc -o s3pic_readconfig.o -c s3pic_readconfig.c

s3pic_writeconfig.o: s3pic_writeconfig.c icsp.h
	gcc -o s3pic_writeconfig.o -c s3pic_writeconfig.c

clean:
	rm -f *.o s3pic_prog s3pic_cntl s3pic_dump
